<div class="page-product">
	<div class="product-header clearfix">
		<i class="icon icon-back" ng-click="back()"></i>
		<a href="javascript:void(0);" ng-click="switchTab(1)" class="product-tab-title" ng-class="{'selected':selection.tab == 1}">商品</a>
		<a href="javascript:void(0);" ng-click="switchTab(2)" class="product-tab-title" ng-class="{'selected':selection.tab == 2}">详情</a>
		<a href="javascript:void(0);" ng-click="switchTab(3)" class="product-tab-title" ng-class="{'selected':selection.tab == 3}">评价</a>
	</div>

	<section class="product-tab-section base-info" ng-show="selection.tab == 1">
		<div class="product-banner">
			<div class="swiper-container" id="productSlider" style="position:relative;">
			  <ul class="swiper-wrapper">
			    <li class="swiper-slide" ng-repeat="image in product.images track by $index" on-ng-repeat-end="initSwiper()">
			      <img class="" ng-src="{{image}}">
					<div class="p-icon-b lp">
						<img ng-if="product.show_new==1" ng-src="image/tag/new.png">
					</div>
					<div class="p-icon-b rp">
						<img ng-if="product.recommend==1" ng-src="image/tag/recommend.png">
						<img ng-if="product.clearance==1 && product.show_clearance==1" ng-src="image/tag/clearance.png">
						<img ng-if="product.promotion==1" ng-src="image/tag/promotion.png">
					</div>
			      <div class="top-left-icon" ng-show="product.upc==1">
	            <img ng-src="catalog/view/theme/bhz/m/images/628logo.png">
	          </div>
	          <div class="top-left-icon" ng-show="product.upc==2">
	            <img ng-src="catalog/view/theme/bhz/m/images/miaoshaicon.png">
	          </div>
	          <div class="bottom-left-icon" ng-show="product.upc==1">
	            <div class="count-number">{{product.jan}}</div>
	          </div>
			     </li>
			  </ul>
			  <div class="swiper-pagination" id="productSwiperPagination"></div>
			</div>
		</div>
		<div class="product-first">
			<div class="name">
				<span ng-if="product.lack_status == 2">D-</span><span ng-if="product.lack_status == 3">I-</span>{{product.name}}
				<span ng-if="product.show_cart==2" style="color:red;">(正在备货中)</span>
				<p class="stock-big-tips" ng-if="product.lack_status == 2 || product.lack_status == 3">{{product.lack_reason}}</p>
			</div>
			<div class="price-wrap">
				<span class="price">{{product.special_formated}}</span>
				<span class="price-old">{{product.price_formated}}</span>
			</div>
			<div class="price-wrap">
				<span class="product_code">商品编码: {{product.options[0].option_value[0].product_code}}</span>
			</div>
			<div class="price-wrap">
				<span class="sku"><span style="margin-left:16px;">条形码: </span>{{product.sku}}</span>
			</div>
			<div class="price-wrap">
				<span class="sku"><span style="margin-left:16px;">装箱数: </span>{{product.packing_no}}</span>
			</div>
			<div class="price-wrap"  ng-if="product.clearance==1|| product.lack_status == 3||myuserId!=0">
				<span class="sku"><span style="margin-left:16px;">库存: </span>{{product.clearqty}}</span>
			</div>
			<div ng-show="bhz_user.need_review==1" class="price-notice">该价格为零售价，登录加盟后可享受工厂供货价。</div>
		</div>
		<div class="product-third clearfix">
			<a ng-if="product.product_type == 1" class="first clearfix" href="javascript:void(0);" ng-click="selectOption();">
				<div class="title">请选择{{product.options[0].name}}</div>
				<div class="content">
					<div style="background-color: #B13638;border-color: #B13638;color: #fff;padding: 0 5px;" ng-if="currProductOption && currProductOption.product_option_value_id">
						{{currProductOption.name}}<span class="text-red" ng-if="currProductOption.price != '0.00'">({{currProductOption.price_prefix}}{{currProductOption.price_formated}})</span>
					</div>
					<div ng-if="!currProductOption || !currProductOption.product_option_value_id">请选择规格尺寸>></div>
				</div>
			</a>
			<div class="second clearfix">
				<div class="title">物流</div>
				<div class="content">从 无锡 物流中心 发货 预计2天到达<i class="icon icon-location"></i>
				<br>订单金额满￥<strong>500</strong>起免费配送</div>
			</div>
		</div>
        
        <!--商品组合-->
        <div ng-if="product.product_type == 2">
            <div class="group-title">套装包含商品</div>
            <div class="product-list-wrap">
				<div class="btn-layer">
					<span class="check-span clean-all" ng-click="cleanAll()">清空</span>
					<span class="check-span check-all" ng-click="checkAll()">全选</span>
				</div>
                <ul class="product-list group-list">
                    <li class="product-item clearfix" ng-repeat="gp in product.group_products">
                        <div class="pro-image">
                            <img ng-src="{{gp.image}}" />
                            <span ng-if="gp.is_single==1">
                                <a style="text-decoration: underline;font-size:14px;color:#212121" href="javascript:void(0);" ng-click="fastAdd(gp)">加入进货单</a>
                            </span>
                            <span ng-if="gp.is_single==0" style="font-size:12px;text-align:center;color:gray;">
                                非单卖商品!
                            </span>
                        </div>
                        <div class="info" style="float:left;">
                            <div class="name auto-cut-word-two-line" ng-click="gotoProduct(gp.id)"><strong>{{gp.name | cut:true:20:' ...'}}</strong></div>
                            <div>商品编码: {{gp.code}}</div> 
                            <div>条形码: {{gp.sku}}</div>
                            <div>单价: <font color="red">￥{{ gp.special | number:2 }}</font></div>
                            <div>
                            	套装数量: <font color="blue">{{gp.qty}}</font>
                                <span class="change-group-quantity" ng-if="gp.is_single==1">
                         			需求数量: <input class="group-quantity" name="submit-quantity{{gp.id}}" type="text" onkeyup="value=this.value.replace(/\D+/g,'')" value="{{gp.qty}}">
                            	</span>
                        	</div> 
                        </div>
                         <div class="right-check">
                        	<input class="check-box" type="checkbox" checked />
							<input type="hidden" name="gp_id" value="{{gp.id}}" />
							<input type="hidden" name="gp_is_single" value="{{gp.is_single}}" />
                   		 </div>
                    </li>
                </ul>
            </div>
        </div>
    	<!--商品组合-->
        
		<div class="product-fourth clearfix">
			<div class="title">评价</div>
			<div class="review-totals">{{product.reviews.reviews_menu.reviews_total}}人评价</div>
			<div class="rating-wrap">
				<span class="score">{{product.reviews.reviews_menu.review_total_rating}}</span>
				<i class="icon icon-star-fill" ng-if="product.reviews.reviews_menu.review_total_rating > 0"></i>
				<i class="icon icon-star" ng-if="product.reviews.reviews_menu.review_total_rating <= 0"></i>
				<i class="icon icon-star-fill" ng-if="product.reviews.reviews_menu.review_total_rating > 1"></i>
				<i class="icon icon-star" ng-if="product.reviews.reviews_menu.review_total_rating <= 1"></i>
				<i class="icon icon-star-fill" ng-if="product.reviews.reviews_menu.review_total_rating > 2"></i>
				<i class="icon icon-star" ng-if="product.reviews.reviews_menu.review_total_rating <= 2"></i>
				<i class="icon icon-star-fill" ng-if="product.reviews.reviews_menu.review_total_rating > 3"></i>
				<i class="icon icon-star" ng-if="product.reviews.reviews_menu.review_total_rating <= 3"></i>
				<i class="icon icon-star-fill" ng-if="product.reviews.reviews_menu.review_total_rating > 4"></i>
				<i class="icon icon-star" ng-if="product.reviews.reviews_menu.review_total_rating <= 4"></i>
			</div>
		</div>
		<div class="product-fifth" ng-if="product.vendor && product.vendor.vendor_id && product.product_type != 2">
			<a href="javascript:void(0);" class="vendor-wrap" ng-click="jump('vendor/'+product.vendor.vendor_id)">
				<i class="icon icon-category-star"></i>
				<img class="icon-category" ng-src="{{product.vendor.vendor_image}}">
				<span class="category-name">进入店铺<!-- {{product.vendor.vendor_name}} --></span>
			</a>
		</div>
		<div class="product-sixth" ng-if="product.related.success">
			<div class="related-title">猜你喜欢</div>
			<div class="related-products-list clearfix">
				<div class="product-item" ng-repeat="productItem in product.related.data">
					<a class="product-link" href="javascript:void(0);" ng-click="gotoProduct(productItem.product_id)">
						<img class="product-image" ng-src="{{productItem.thumb}}">
						<div class="name auto-cut-word-line">{{productItem.name}}</div>
						<div class="price-wrap">
							<span class="price">{{productItem.special}}</span>
							<span class="price-old">{{productItem.price}}</span>
						</div>
					</a>
				</div>
			</div>
		</div>
	</section>
	<section class="product-tab-section description" ng-show="selection.tab == 2">
		<div class="desc-tab-header">
			<a href="javascript:void(0);" ng-click="selection.secondTab = 1" class="desc-tab-title" ng-class="{'selected':selection.secondTab == 1}">商品介绍</a>
			<a href="javascript:void(0);" ng-click="selection.secondTab = 2" class="desc-tab-title" ng-class="{'selected':selection.secondTab == 2}">规格参数</a>
			<a href="javascript:void(0);" ng-click="selection.secondTab = 3" class="desc-tab-title" ng-class="{'selected':selection.secondTab == 3}">包装售后</a>
		</div>
		<div class="desc-tab-content">
			<div class="desc-tab-content-item desc" ng-show="selection.secondTab == 1"><p ng-bind-html="product.description"></p></div>
			<div class="desc-tab-content-item args" ng-show="selection.secondTab == 2">
				<div class="recommon-price">
					<div class="recommon-price-title">建议零售价</div>
					<div class="recommon-price-content">{{product.price_formated}}</div>
				</div>
				<table class="args-table">
					<tr>
						<th colspan="2">主体</th>
					</tr>
					<tr ng-repeat="(key,argsItem) in product.attr_args">
						<td class="td-title">{{argsItem.name}}</td>
						<td class="td-content">{{argsItem.text}}</td>
					</tr>
				</table>
			</div>
			<!-- <div class="desc-tab-content-item after-sale" ng-show="selection.secondTab == 3">{{product.attribute_groups[0].attribute[0].text}}</div> -->
			<div class="desc-tab-content-item after-sale" ng-show="selection.secondTab == 3" ng-include="BHZConfig.MODULE_PATH+'product/after_sales.html'"></div>
		</div>
	</section>
	<section class="product-tab-section reviews" ng-show="selection.tab == 3">
		<div class="reviews-totals-list">
			<div class="reviews-totals-item totals">
				<div>全部评价</div>
				<div>{{product.reviews.reviews_menu.reviews_total}}</div>
			</div>
			<div class="reviews-totals-item good">
				<div>好评</div>
				<div>{{product.reviews.reviews_menu.rating_best}}</div>
			</div>
			<div class="reviews-totals-item normal">
				<div>中评</div>
				<div>{{product.reviews.reviews_menu.rating_mid}}</div>
			</div>
			<div class="reviews-totals-item bad">
				<div>差评</div>
				<div>{{product.reviews.reviews_menu.rating_bad}}</div>
			</div>
		</div>
		<div class="reviews-list">
			<div class="reviews-item" ng-repeat="review in product.reviews.reviews">
				<div class="review-header clearfix">
					<div class="author-wrap">
						<div class="author-img"><img ng-src="{{review.avatar}}"></div>
						<div class="author-name">{{review.author}}</div></div>
					<div class="review-date">{{review.date_added}}</div>
				</div>
				<div class="review-rating">
					<i class="icon icon-star-fill" ng-if="review.rating > 0"></i>
					<i class="icon icon-star" ng-if="review.rating <= 0"></i>
					<i class="icon icon-star-fill" ng-if="review.rating > 1"></i>
					<i class="icon icon-star" ng-if="review.rating <= 1"></i>
					<i class="icon icon-star-fill" ng-if="review.rating > 2"></i>
					<i class="icon icon-star" ng-if="review.rating <= 2"></i>
					<i class="icon icon-star-fill" ng-if="review.rating > 3"></i>
					<i class="icon icon-star" ng-if="review.rating <= 3"></i>
					<i class="icon icon-star-fill" ng-if="review.rating > 4"></i>
					<i class="icon icon-star" ng-if="review.rating <= 4"></i>
				</div>
				<div class="review-content">{{review.text}}</div>
			</div>
		</div>
	</section>
	
	<div class="product-footer clearfix">
		<a href="javascript:void(0);" class="cart-wrap" ng-click="addTowishlist();">
			<img class="wishlist-img" src="catalog/view/theme/bhz/m/images/wishlist2.png" ng-if="product.is_in_wishlist">
			<img class="wishlist-img" src="catalog/view/theme/bhz/m/images/wishlist.png" ng-if="!product.is_in_wishlist">
			<div class="wishlist-text">收藏</div>
		</a>
		<a href="javascript:void(0);" class="cart-wrap" ng-click="jump('/cart')">
			<img class="cart-img" src="catalog/view/theme/bhz/m/images/cart.png">
			<div class="cart-text">进货单</div>
		</a>
		<a href="javascript:void(0);" class="add-cart" ng-click="singleToCart();">加入进货单</a>
		<a href="javascript:void(0);" class="buy" ng-click="batchBuy();">立即购买</a>
	</div>

	<div class="select-product-section" ng-class="{'show':selectShow}">
		<div class="select-wrap">
			<i class="icon icon-close" ng-click="closeSelectOption()"></i>
			<div class="product-info">
				<table>
					<tr>
						<td class="product-image-wrap">
							<img ng-src="{{product.image}}">
						</td>
						<td class="product-base">
							<div class="name auto-cut-word-two-line">{{product.name}}</div>
							<div class="price">{{product.option_price || product.special_formated}}</div>
						</td>
					</tr>
				</table>
			</div>
			<div class="product-option" ng-if="product.options && product.options.length>0">
				<div class="option-title">{{product.options[0].name}}：</div>
				<ul class="option-list clearfix">
					<li class="option-item" ng-repeat="(key,optionItem) in product.options[0].option_value" ng-click="switchOption(key)" ng-class="{'selected':optionItem.product_option_value_id == currProductOption.product_option_value_id}">{{optionItem.name}}</li>
				</ul>
			</div>
			<div class="quantity-wrap">
				<div class="quantity-title">购买数量（{{product.minimum}}个起批）：</div>
				<div class="quantity-input-wrap clearfix">
					<span class="reduce update-quantity" ng-click="updateQuantity('reduce',product)">-</span>
					<input type="text" ng-model="selection.quantity" onkeyup="value=this.value.replace(/\D+/g,'')" />
					<span class="add update-quantity" ng-click="updateQuantity('add',product)">+</span>
				</div>
			</div>
			<div class="select-footer clearfix">
				<a href="javascript:void(0);" class="add-cart" ng-click="addToCart(true);">加入进货单</a>
				<a href="javascript:void(0);" class="buy" ng-click="gotoBuy(true);">立即购买</a>
			</div>
		</div>
	</div>

</div>